package net.wofly.sale.commodity.service.impl;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import net.wofly.sale.commodity.repository.CommodityDescRepository;
import net.wofly.sale.commodity.domain.CommodityDesc;
import net.wofly.sale.commodity.service.ICommodityDescService;

@Service("iCommodityDescService")
@Transactional
public class CommodityDescServiceImpl implements ICommodityDescService {

	@Autowired
	CommodityDescRepository commodityDescRepository;

	@Override
	public CommodityDesc save(CommodityDesc entity) {
		return commodityDescRepository.save(entity);
	}

	@Override
	public void delete(CommodityDesc entity) {
		commodityDescRepository.delete(entity);
	}

	@Override
	public void delete(String key) {
		commodityDescRepository.delete(key);
	}

	@Override
	public CommodityDesc findOne(String key) {
		return commodityDescRepository.findOne(key);
	}

	@Override
	public List<CommodityDesc> save(List<CommodityDesc> entityList) {
		return (List<CommodityDesc>) commodityDescRepository.save(entityList);
	}
}
